import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        bColor: 'deepskyblue',
        bgColor:['green','skyblue','pink','yellow','black','deepskyblue']
    },
    mutations: {
        setBgColor(state) {
            let num = Math.floor(Math.random() * 10)
            if (num > 5) {
                num = num - 4
            }
            state.bColor=state.bgColor[num]
        }
    },
    actions: {},
    modules: {}
})
